package com.prestamomo.vil.ppa.pmvilpage.pmrot;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public abstract class PmvilFgRoot extends Fragment {


    protected PmvilAtyRoot pmvilAtyRoot;
    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        if(context instanceof PmvilAtyRoot){
            pmvilAtyRoot = (PmvilAtyRoot) this.getActivity();
        }
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }


    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        findPmvilViewById(view);
        setViewPmvilData(view);
        setClickPmvilEvent(view);
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(setPmvilLayoutId(), container, false);
    }


    public abstract int setPmvilLayoutId();

    public abstract void findPmvilViewById(View view);

    /**
     * setViewData
     */
    public abstract void setViewPmvilData(View view);

    /**
     * setClickEvent
     */
    public abstract void setClickPmvilEvent(View view);
}
